package cn.com.aiouyi.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import freemarker.ext.servlet.IncludePage;

public class ShareRenderArgsVariableInterceptor extends HandlerInterceptorAdapter {   
       
    @Override  
    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,   
            ModelAndView modelAndView) throws Exception {   
        if(modelAndView != null && modelAndView.getViewName() != null && !modelAndView.getViewName().startsWith("redirect:")) {   
            //freemarker 原生的IncludePage指令   
            modelAndView.addObject("include_page", new IncludePage(request, response));   
        }   
    }   
  
}  
